﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _11._10._2014_IntroCSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Car> cars = new List<Car>();
            //List<Optima> optimas = new List<Optima>();

            Accord nicksCar = new Accord();
            nicksCar.Color = "Blue";
            nicksCar.Year = 2006;
            nicksCar.Wheels = 4;
            nicksCar.IsReliable = true;

            cars.Add(nicksCar);

            Optima kevinsCar = new Optima();
            kevinsCar.Color = "Cherry Black";
            kevinsCar.Year = 2014;
            kevinsCar.Wheels = 4;
            kevinsCar.HasGoodGasMilage = true;

            cars.Add(kevinsCar);

            foreach(Car car in cars)
            {
                Console.WriteLine(car.Color);
                Console.WriteLine(car.Make);
                if (car is Accord)
                {
                    Accord accord = car as Accord;
                    Console.WriteLine(accord.IsReliable);
                }

                if (car is Optima)
                {
                    Optima optima = car as Optima;
                    Console.WriteLine(optima.HasGoodGasMilage);
                }
                
                car.Honk();
                Console.WriteLine();
            }

            //Person person1 = new Person("Nick", "Brittain");
            //string name = person1.FirstName;

            //Person person2;
            //person2 = new Person();


            //Console.WriteLine(name);
            //Console.WriteLine(person1.LastName);

            //person1.Scream();

            Console.ReadLine();
        }
    }
}
